#!/bin/sh
monitor="eDP-1"
brightness=$(xrandr --verbose --current | grep ^"$monitor" -A5 | tail -n1 | tr -d -c '0-9\.')

case $1 in
    -i)
        command="echo '$brightness + 0.1' | bc"
        new_brightness=$(eval "$command")
        ;;
    -d)
        command="echo '$brightness - 0.1' | bc"
        new_brightness=$(eval "$command")
        ;;
esac
xrandr --output $monitor --brightness $new_brightness
